<?php

class Application_Form_Contrainte extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	
    	$this->setName("Formulairecontraint");
     
    	 
  		$mapper= new Application_Model_Mapper_PilotRequest();
    	$select=$mapper->fetchAllToArray();
    	 
    	 
    	$tmp=array();
    	$tmp['']="selectionner requete";
    	foreach ($select as $key => $value ){
    		$tmp[ $value['idPILOT_REQUEST'] ] = $value['LABELRequest'];
    	}
    	$listModelActivite = array("multiOptions" => $tmp);
    	 
    	$Model= new Zend_Form_Element_Select('REQUESTTEXT',  $listModelActivite);
    	$Model->setLabel('Titre de requete')	;
    	
    	$identificateur = new Zend_Form_Element_Text('idPILOT_REQUESTCOMP');
    	$identificateur->setLabel('identificateur')
    	->setRequired(true)
    	->addFilter('StripTags')
    	->addFilter('StringTrim')
    	->addValidator('NotEmpty')
    	->setAttrib('class','validate[required] text-input');
    	 
    	 
   
    	$WHEREZONE = $this->CreateElement('textarea', 'WHEREZONE');
    	$WHEREZONE->setAttrib('rows', '7');
    	$WHEREZONE->setAttrib('cols', '35');
    	$WHEREZONE->setLabel('WHERE ZONE');
    	
    	$FROMZONE = $this->CreateElement('textarea', 'FROMZONE');
    	$FROMZONE->setAttrib('rows', '7');
    	$FROMZONE->setAttrib('cols', '35');
    	$FROMZONE->setLabel('FROM ZONE');
    	
    	$SELECTZONE = $this->CreateElement('textarea', 'SELECTZONE');
    	$SELECTZONE->setAttrib('rows', '7');
    	$SELECTZONE->setAttrib('cols', '35');
    	$SELECTZONE->setLabel('SELECT ZONE');
    	
    	$GROUPBYZONE = $this->CreateElement('textarea', 'GROUPBYZONE');
    	$GROUPBYZONE->setAttrib('rows', '7');
    	$GROUPBYZONE->setAttrib('cols', '35');
    	$GROUPBYZONE->setLabel('GROUPBY ZONE');
    	
    	$HAVAINGZONE = $this->CreateElement('textarea', 'HAVAINGZONE');
    	$HAVAINGZONE->setAttrib('rows', '7');
    	$HAVAINGZONE->setAttrib('cols', '35');
    	$HAVAINGZONE->setLabel('HAVAING ZONE');
    	
    	$JOINTUREZONE = $this->CreateElement('textarea', 'JOINTUREZONE');
    	$JOINTUREZONE->setAttrib('rows', '7');
    	$JOINTUREZONE->setAttrib('cols', '35');
    	$JOINTUREZONE->setLabel('JOINTURE ZONE');
    	
    	$ORDERBYZONE = $this->CreateElement('textarea', 'ORDERBYZONE');
    	$ORDERBYZONE->setAttrib('rows', '7');
    	$ORDERBYZONE->setAttrib('cols', '35');
    	$ORDERBYZONE->setLabel('ORDERBY ZONE');
    	 
    	$valider = new Zend_Form_Element_Submit("submit");
    	$valider->setLabel("Ajouter");
    	 
    	$this->addElements(array($Model,$identificateur,$SELECTZONE,$FROMZONE,$WHEREZONE,$JOINTUREZONE,$GROUPBYZONE,$HAVAINGZONE,$ORDERBYZONE,$valider));
    	$this->setDecorators( array( array('ViewScript', array('viewScript' => 'protypeform.phtml'))));
    	 
    	}
    	
    	 
    }




